package org.osforce.platform.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;


/**
 * 用户实体类
 * 
 * username --> 用户名
 * password --> SHA 哈希后的密码
 * nickname --> 昵称
 * email    --> 电子邮件
 * ip       --> ip 地址
 * registerTime --> 注册时间
 * loggedinTime --> 上次登录时间
 * loginTime --> 本次登录时间
 * enabled --> 用户是否被启用 默认是启用的 
 * 
 * @author gavin
 * @since 0.0.1
 */
@Entity
@Table(name="users")
public class User extends IdEntity{

	private static final long serialVersionUID=-4975615560473925025L;

	private String userName;
	private String passWord;
	private String nickName;
	private String email;
	private String ip;
	private Date registerTime;
	private Date loggedinTime;
	private Date loginTime;
	private Boolean enabled=Boolean.TRUE;

	public User(){
	}

	@Column(name="username")
	public String getUserName(){
		return userName;
	}

	public void setUserName(String userName){
		this.userName=userName;
	}

	@Column(name="password")
	public String getPassWord(){
		return passWord;
	}

	public void setPassWord(String passWord){
		this.passWord=passWord;
	}

	@Column(name="nickname")
	public String getNickName(){
		return nickName;
	}

	public void setNickName(String nickName){
		this.nickName=nickName;
	}

	@Column(name="email")
	public String getEmail(){
		return email;
	}

	public void setEmail(String email){
		this.email=email;
	}

	@Column(name="ip")
	public String getIp(){
		return ip;
	}

	public void setIp(String ip){
		this.ip=ip;
	}

	@Column(name="registertime")
	public Date getRegisterTime(){
		return registerTime;
	}

	public void setRegisterTime(Date registerTime){
		this.registerTime=registerTime;
	}

	@Column(name="loggedintime")
	public Date getLoggedinTime(){
		return loggedinTime;
	}

	public void setLoggedinTime(Date loggedinTime){
		this.loggedinTime=loggedinTime;
	}

	@Column(name="logintime")
	public Date getLoginTime(){
		return loginTime;
	}

	public void setLoginTime(Date loginTime){
		this.loginTime=loginTime;
	}

	@Column(name="enabled")
	public Boolean getEnabled(){
		return enabled;
	}

	public void setEnabled(Boolean enabled){
		this.enabled=enabled;
	}

}
